package com.neo.pub.service.impl;

import com.neo.common.annotation.DataSource;
import com.neo.common.enums.DataSourceType;
import com.neo.pub.domain.Patient;
import com.neo.pub.domain.Schedule;
import com.neo.pub.mapper.PatientMapper;
import com.neo.pub.mapper.ScheduleMapper;
import com.neo.pub.service.IPatientService;
import com.neo.pub.service.IScheduleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户 业务层处理
 * 
 * @author tr
 */
@Service("scheduleService")
@DataSource(value = DataSourceType.SBH)
public class ScheduleServiceImpl implements IScheduleService
{
    private static final Logger log = LoggerFactory.getLogger(ScheduleServiceImpl.class);

    @Autowired
    private ScheduleMapper scheduleMapper;


    @Override
    public List<Schedule> selectSchedules(Schedule schedule) {
        String startTime = schedule.getStartTime();
        String endTime = schedule.getEndTime();
        startTime = startTime + " 00:00:00";
        endTime = endTime + " 23:59:59";
        schedule.setStartTime(startTime);
        schedule.setEndTime(endTime);
        return scheduleMapper.selectScheduleList(schedule);
    }

    @Override
    public List<Schedule> selectScheduleDicts() {
        return scheduleMapper.selectScheduleDict();
    }
}
